﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowMainAndLog.aspx.cs" Inherits="Workflow.Project.ShowMainAndLog" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <link type="text/css" rel="stylesheet" href="../Css/pagination.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>

    <script type="text/javascript" src="../Scripts/MyJquery.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.pagination.js"></script>
    <script type="text/javascript" src="../Scripts/Pageination.js"></script>
</head>
<body>
    <form id="form1" runat="server">
     <div style="margin:40px;">
            <a href="SearchMainAndLog.aspx"><img src="../Images/返回 (32).png" /></a>
        </div>
    <div>
        <table class="table table-bordered definewidth m10">
                <thead>
                    
                        <tr>
                            <th>模具号</th>
                            <th>创建人</th>
                            <th>T1</th>
                            <th>T2</th>
                            <th>T3</th>
                            <th>T4</th>
                            <th>T5</th>
                            <th>备注</th>
                            <th>项目活动/问题</th>
                            <th>活动清单</th>
                        </tr>
                    
                </thead>
                <tbody id="Searchresult">
                    <% for (int i = 0; i < resultList.Count; i++){ %>
                        <tr class="result">
                            <td><a href="#" onclick="SearchLog('SearchMain1.aspx','<%= resultList[i].PJId %>')"><% =resultList[i].PJId %></a></td>
                            <td><% =resultList[i].DisplayName %></td>
                            <td id="t1<%=i %>">
                                <label id="l1end<%=i %>" class="date">估:<%=resultList[i].StrT1EndDate%></label>
                                <label id="l1realend<%=i %>" class="date">实:<%=resultList[i].StrT1RealEndDate%></label>
                            </td>
                            <td id="t2<%=i %>">
                                <label id="l2end<%=i %>" class="date">估:<%=resultList[i].StrT2EndDate%></label>
                                <label id="l2realend<%=i %>" class="date">实:<%=resultList[i].StrT2RealEndDate%></label>
                            </td>
                            <td id="t3<%=i %>">
                                <label id="l3end<%=i %>" class="date">估:<%=resultList[i].StrT3EndDate%></label>
                                <label id="l3realend<%=i %>" class="date">实:<%=resultList[i].StrT3RealEndDate%></label>
                            </td>
                            <td id="t4<%=i %>">
                                <label id="l4end<%=i %>" class="date">估:<%=resultList[i].StrT4EndDate%></label>
                                <label id="l4realend<%=i %>" class="date">实:<%=resultList[i].StrT4RealEndDate%></label>
                            </td>
                            <td id="t5<%=i %>">
                                <label id="l5end<%=i %>" class="date">估:<%=resultList[i].StrT5EndDate%></label>
                                <label id="l5realend<%=i %>" class="date">实:<%=resultList[i].StrT5RealEndDate%></label>
                            </td>
                            <td>
                                <a id="a<%=i %>"href="#" onclick="UpdatePs('UpdatePs.aspx','<%= resultList[i].PJId %>','PJMain')"><%=resultList[i].Ps%></a>
                            </td>
                            <td>
                                <%=resultList[i].Problem%>
                            </td>
                            <td>
                                <a href="#" onclick="SearchLog('SearchLog.aspx','<%=resultList[i].PJId%>')">活动详情</a>
                            </td>
                        </tr>
                    <% }%>
                </tbody>
               
            </table>
    </div>
    </form>
    <script type="text/javascript">
        $(document).ready(function () {
            List();
            function List() {
                var count = "<% =resultList.Count%>";
                for (var i = 0; i < count; i++) {
                    ShowColor("#l1end", "#l1realend", "#t1", i);
                    ShowColor("#l2end", "#l2realend", "#t2", i);
                    ShowColor("#l3end", "#l3realend", "#t3", i);
                    ShowColor("#l4end", "#l4realend", "#t4", i);
                    ShowColor("#l5end", "#l5realend", "#t5", i);
                    ShowWord("#a", i);
                }
            }
            function ShowWord(str1,i) {
                var txt = $(str1 + i).text();
                if (txt == "") {
                    $(str1 + i).text("添加备注");
                }
            }
            function ShowColor(str1, str2, str3, i) {
                var date1 = new Date($(str1 + i).text());
                var date2 = new Date($(str2 + i).text());
                var today = Date.now();
                var now = new Date();
                var tomorrow = now.setDate(now.getDate() + 15);
                if (date1 >= date2) {
                    $(str3 + i).attr("class", "lightgrayColor");
                }
                else if (date1 < date2) {
                    $(str3 + i).attr("class", "grayColor");
                }
                else if ($(str2 + i).text() == "实:" && date1 < today) {
                    $(str3 + i).attr("class", "redColor");
                }
                else if ($(str2 + i).text() == "实:" && date1 <= tomorrow) {
                    $(str3 + i).attr("class", "yellowishColor");
                }
            }
        });
    </script>
</body>
</html>
